<?php
session_start();

if(isset($_POST["login"])){
	include("/class.login.php");
	$login = new Login();
	
	if($login->isLoggedIn()){
		echo "Je bent ingelogd!";
	}
	else{
		$login->showErrors();
	}
}

$_SESSION['token'] = $token =  md5(uniqid(mt_rand(),true));
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Login</title>

</head>

<body>
<form action="login.php" method="post">
 Username:
 <input type="text" name="username" />
 <br><br>
 Login:
 <input type="password" name="password" />
 <br><br>
 <input type="hidden" name="token" value="<?php echo $token; ?>" />
 <input type="submit" name="login" value="Log in" />
</form>
<hr />

</body>
</html>